#pragma once
#include "EXSliderCtrlResSet.h"

// CEXSliderCtrl

class AFX_EXT_CLASS CEXSliderCtrl : public CSliderCtrl
{
	DECLARE_DYNAMIC(CEXSliderCtrl)

public:
  enum SLIDER_STYLE
  {
    NOIMAGE,
    SLIDER_CTRL = 18,
  };
	CEXSliderCtrl();
	virtual ~CEXSliderCtrl();

	BOOL SetBitmaps(UINT nBkgndID, UINT nThumbID, int nCount, int nTopHeight=0, 
                  int nBottomHeight=0, int nLeftWidth=0, int nRightWidth=0);
	void SetBkgndColor(COLORREF crBkgnd);


  void SetResSet(CEXBaseResSet* pResSet);
  CEXSliderCtrlResSet* m_pSliderResSet;

protected:
	BOOL InitBgBitmap(CRect & rcWnd, CBitmap & src, CBitmap & dist, int index, 
                   int count, int nTopHeight, int nBottomHeight, 
                   int nLeftWidth, int nRightWidth);

	enum STATUS
	{
		normal,
		focus,
		select,
		disable
	};

	BOOL m_bSetBitmap;

	int m_nTopHeight;
	int m_nBottomHeight;
	int m_nLeftWidth;
	int m_nRightWidth;

	UINT m_nBkgndID;
	UINT m_nThumbID;

	int m_nNumOfBgPics;
	COLORREF m_crTransparent;

	CBitmap m_bmpChannelBkgnd;
	CBitmap m_bmpThumb;

	COLORREF m_crBkgnd;
	BOOL m_bFocus;
	BOOL m_bSelect;

protected:
	DECLARE_MESSAGE_MAP()
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
public:
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg LRESULT OnMouseLeaveNotify(WPARAM w, LPARAM l);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
};


